import { Model } from 'dva';
import Service from '@/public/http/services';
export default {
    namespace: 'media',
    state: {
        list: [],
        total: 0
    },
    effects: {
        *fetchList({ payload }, { put, call }) {
            const result = yield call(Service.queryvmResource, payload);
            yield put({ type: 'setList', payload: result });
        },
    },
    reducers: {
        setList(state, { payload: { list, pageCount } }: any) {
            state.list = list;
            state.total = pageCount;
            return state;
        }
    },
} as Model

